Open
Conversation
1356302 to
c313a9a
Compare
mdellweg
reviewed
Feb 19, 2026
| self.heartbeat() | ||
|
|
||
| def _heartbeat_loop(self): | ||
| while self.alive: |
| super().notify() | ||
| self.heartbeat() | ||
|
|
||
| def _heartbeat_loop(self): |
Member
There was a problem hiding this comment.
What happens if the thread dies?
| super().__init__(*args, **kwargs) | ||
| self.heartbeat_thread = None | ||
|
|
||
| def notify(self): |
Member
There was a problem hiding this comment.
First i thought, this is dead code. Now i think we have the opportunity to check in on the thread here.
| # Store heartbeat interval for the heartbeat thread | ||
| self.heartbeat_interval = settings.API_APP_TTL // 3 | ||
|
|
||
| # Start heartbeat thread before entering the main loop |
Member
There was a problem hiding this comment.
Now why don't we then put all of that stuff right before entering the main loop?
| name_template = name_template_var.get() | ||
| if name_template: | ||
| settings.set("WORKER_NAME_TEMPLATE", name_template) | ||
| if settings.API_APP_TTL < 2 * self.timeout: |
Member
There was a problem hiding this comment.
Did you never get to see this warning?
| logger.error(f"An API app with name {self.name} already exists in the database.") | ||
| exit(Arbiter.WORKER_BOOT_ERROR) | ||
|
|
||
| # Store heartbeat interval for the heartbeat thread |
Member
There was a problem hiding this comment.
Suggested change
| # Store heartbeat interval for the heartbeat thread | |
| # Store the value of one third of the desired API application's time to live to the heartbeat interval on the current instance to be accessible by the heartbeat thread. |
:mild sarcasm:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fixes: #7315
📜 Checklist
See: Pull Request Walkthrough